package com.bjdd.jdy.entity;

import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;

import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.List;

/**
 * Created by Administrator on 2017/4/11.
 */

public class TokenResult {

    /**
     * token : eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiIxMzY1NTk0NTU5MyIsImF1ZGllbmNlIjoid2ViIiwiY3JlYXRlZCI6MTQ5MTg5MTI5MDQzMywiZXhwIjoxNDk0NDgzMjkwfQ.2Qwp01OxokpXOAadW3Wltjf_RiKyhxHvaPS6Y69SuAdqMj-j0eHQchashPLd1zRrf84QfQNLPIx8w9_Y4Bv8fQ
     * userId : 2
     */

    private String token;
    private String userId;

    public static TokenResult objectFromData(String str) {

        return new Gson().fromJson(str, TokenResult.class);
    }

    public static List<TokenResult> arrayTokenResultFromData(String str) {

        Type listType = new TypeToken<ArrayList<TokenResult>>() {
        }.getType();

        return new Gson().fromJson(str, listType);
    }

    public String getToken() {
        return token;
    }

    public void setToken(String token) {
        this.token = token;
    }

    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }
}
